package com.groupten.Service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.groupten.Entity.QuestionEntity;
import com.groupten.Entity.StudentPaperEntity;
import com.groupten.Vo.IndividualVo;

import java.util.List;
import java.util.Map;

public interface StudentPaperService extends IService<StudentPaperEntity> {
    /**
     * 添加学生的答题试卷记录
     * @param studentPaperEntity
     * @return 添加是否成功
     */
    Integer insertStudentPaper(StudentPaperEntity studentPaperEntity);

    /**
     * 根据ID删除相关学生答题试卷
     * @param StudentPaperId
     * @return 删除是否成功
     */
    Integer deleteStudentPaperById(Long StudentPaperId);

    /**
     * 查找学生的全部答题记录
     * @param page
     * @param limit
     * @return 学生的所有答题试卷记录
     */
    IPage<StudentPaperEntity> selectAll(Integer page, Integer limit);

    /**
     * 根据学号查找学生试卷
     * @param StudentNumber
     * @return 含有相关信息的IPage对象
     */
    IPage<StudentPaperEntity> selectStudentPaperByNumber(String StudentNumber, Integer page, Integer limit);

    /**
     * 根据试卷编号查找学生试卷
     * @param Session
     * @param page
     * @param limit
     * @return 含有相关信息的IPage对象
     */
    IPage<StudentPaperEntity> selectStudentPaperBySession(Integer Session, Integer page, Integer limit);

    /**
     * 根据班级号查找学生试卷
     * @param ClassNumber
     * @param page
     * @param limit
     * @return 含有相关信息的IPage对象
     */
    IPage<StudentPaperEntity> selectStudentPaperByClassNumber(String ClassNumber, Integer page, Integer limit);

    List<StudentPaperEntity> getStudentPaperByPaperSession(Integer session);

    List<StudentPaperEntity> getUnAddPaper();

    void updateIsAddToPaper(String studentNumber);

    int rankStudentPaper(String studentNumber , Integer session , Double score);

    StudentPaperEntity getStudentPaperByStudentNumberAndPaperSession(String studentNumber, Integer paperSession);

    void studentPaperIns(Integer paperSession, Map<Double, List<QuestionEntity>> answerResult, String studentClass, String studentID);

    IndividualVo FindMaxAndMin(IndividualVo individualVo , Integer session);

}
